package com.zp.datax.core;

import lombok.Getter;

import java.util.Arrays;

/**
 * @author bruce
 * @date 2019-07-15
 */
@Getter
public enum DataxJobStatus {

    NONE(-1), NORMAL(1), STOP(0);

    private int value;

    DataxJobStatus(int value) {
        this.value = value;
    }

    public static DataxJobStatus matched(int value) {
        return Arrays.stream(values())
                .filter(t -> t.getValue() == value)
                .findFirst()
                .get();
    }
}
